syntax = "proto3";

package spqr;

option go_package = "spqr/proto";

message Shard {
  string id = 1;
  repeated string hosts = 2;
}

message ShardInfo {
  string id = 1;
  repeated string hosts = 2;
}

//TODO is ListShards returns all types of shards or only data-shards?
service ShardService {
  rpc ListShards (ListShardsRequest) returns (ListShardsReply) {}
  rpc AddDataShard (AddShardRequest) returns (AddShardReply) {}
  rpc AddWorldShard (AddWorldShardRequest) returns (AddShardReply) {}
  rpc GetShardInfo (ShardRequest) returns (ShardInfoReply) {}
}

message ShardInfoReply {
  ShardInfo shard_info = 1;
}

message ListShardsRequest {
}

message ShardRequest {
  string id = 1;
}

message ListShardsReply {
	repeated Shard shards = 1;
}

message AddShardRequest {
  Shard shard = 1;
}

message AddShardReply {
}

message AddWorldShardRequest {
  Shard shard = 1;
}